//
//  DBFollowBone.h
//  DragonBonesCPP
//
//  Created by DuanHongbo on 15/1/19.
//
//

#ifndef __DragonBonesCPP__DBFollowBone__
#define __DragonBonesCPP__DBFollowBone__

#include <stdio.h>
#include "cocos2d.h"
#include "CCArmatureDisplay.h"

USING_NS_CC;


DRAGONBONES_NAMESPACE_BEGIN
class DBFollowBone : public ActionInterval
{
public:
    static DBFollowBone* create(float duration, CCArmatureDisplay* armatureNode, const std::string& bone);
    
    
    //
    // Overrides
    //
    virtual DBFollowBone* clone() const override;
    //virtual DBFollowBone* reverse() const override;
    virtual void startWithTarget(Node *target) override;
    virtual void stop(void) override;
    virtual void update(float t) override;
    
protected:
    DBFollowBone();
    virtual ~DBFollowBone();
    
    bool init(float duration,CCArmatureDisplay* armatureNode, const std::string& bone);
    void updatePos();
protected:
    CCArmatureDisplay* _armatureNode;
    std::string _boneName;
    Bone* _bone;
};
DRAGONBONES_NAMESPACE_END


#endif /* defined(__DragonBonesCPP__DBFollowBone__) */
